package com.ml.arrecegor.climaplanetario.model;

public class Posicion implements Comparable<Posicion>{

	private int modulo;
	private int angulo;
	private int x;
	private int y;

	public Posicion(int modulo, int angulo, int x, int y) {
		super();
		this.modulo = modulo;
		this.angulo = angulo;
		this.x = x;
		this.y = y;
	}

	public int getModulo() {
		return modulo;
	}

	public int getAngulo() {
		return angulo;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	@Override
	public int compareTo(Posicion pos) {
		int compareX = Integer.compare(x, pos.getX());
		if (compareX == 0) {
			return Integer.compare(y, pos.getY());
		}
		return compareX;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + angulo;
		result = prime * result + modulo;
		result = prime * result + x;
		result = prime * result + y;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Posicion other = (Posicion) obj;
		if (angulo != other.angulo)
			return false;
		if (modulo != other.modulo)
			return false;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}

	
}
